package com.haven.webrobotserver.service.impl;

import com.haven.webrobotserver.dao.mybatis.mapper.TestcaseMapper;
import com.haven.webrobotserver.domain.query.TestcaseListVOQuery;
import com.haven.webrobotserver.domain.vo.TestcaseVO;
import com.haven.webrobotserver.service.TestcaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TestcaseServiceImpl implements TestcaseService {

    @Autowired(required = false)
    private TestcaseMapper testcaseMapper;

    @Override
    public List<TestcaseVO> getTestcaseVOList(TestcaseListVOQuery testcaseListVOQuery) {

        List<TestcaseVO> testcaseVOList = testcaseMapper.getTestcaseVOList(testcaseListVOQuery);

        return testcaseVOList;
    }

    @Override
    public void newTestcase(TestcaseVO testcaseVO) {
        testcaseMapper.newTestcase(testcaseVO);

    }

    @Override
    public TestcaseVO getTestcaseVObyId(int id) {
        return testcaseMapper.getTestcaseVOById(id);
    }

    @Override
    public void updateTestcase(TestcaseVO testcaseVO) {
        testcaseMapper.updateTestcase(testcaseVO);
    }

    @Override
    public void deleteOne(int id) {
        testcaseMapper.deleteOne(id);
    }

    @Override
    public List<Map<String, String>> getTestcaseListByProjectId(int projectId) {
        return testcaseMapper.getTestcaseListByProjectId(projectId);
    }

}
